TextInputBase<TValue>
Assembly: ServiceStack.Blazor.dll
View Source
public abstract class TextInputBase<TValue> : TextInputBase
Properties
Value
Gets or sets the value of the input. This should be used with two-way binding.
View Source
public TValue Value { get; set; }
ValueChanged
Gets or sets a callback that updates the bound value.
View Source
public EventCallback<TValue> ValueChanged { get; set; }
ValueExpression
Gets or sets an expression that identifies the bound value.
View Source
public Expression<Func<TValue>> ValueExpression { get; set; }
CurrentValue
Gets or sets the current value of the input.
View Source
protected TValue CurrentValue { get; set; }
CurrentValueAsString
Gets or sets the current value of the input, represented as a string.
View Source
protected string CurrentValueAsString { get; set; }
Inherited Properties
AdditionalAttributes
Gets or sets a collection of additional attributes that will be applied to the created element.
View Source
public IReadOnlyDictionary<string, object>? AdditionalAttributes { get; set; }
ErrorField
View Source
public ResponseError? ErrorField { get; }
ErrorFieldMessage
View Source
public string ErrorFieldMessage { get; }
FieldClass
Class for outer container element
View Source
public string FieldClass { get; set; }
FieldIdentifier
Gets the ServiceStack.Blazor.Components.TextInputBase.FieldIdentifier for the bound value.
View Source
protected AspNetCore.Components.Forms.FieldIdentifier FieldIdentifier { get; set; }
HasErrorField
View Source
public bool HasErrorField { get; }
Help
Additional help text for Input Control, defaults to split Pascal Case Id. Set to empty string "" to hide
View Source
public string Help { get; set; }
Id
View Source
public virtual string Id { get; set; }
IncludeAttributes
View Source
public virtual IReadOnlyDictionary<string, object>? IncludeAttributes { get; }
IsCheckbox
View Source
protected bool IsCheckbox { get; }
IsSelect
View Source
protected bool IsSelect { get; }
Label
Label assigned to the Input Control, defaults to split Pascal Case Id. Set to empty string "" to hide
View Source
public string Label { get; set; }
LabelClass
Class for Input Label
View Source
public string LabelClass { get; set; }
placeholder
View Source
public string placeholder { get; set; }
Size
View Source
public string Size { get; set; }
type
View Source
public string type { get; set; }
UseHelp
View Source
protected virtual string UseHelp { get; }
UseLabel
View Source
protected virtual string UseLabel { get; }
UsePlaceholder
View Source
protected virtual string UsePlaceholder { get; }
UseType
View Source
protected virtual string UseType { get; }
Methods
FormatValueAsString(TValue)
Formats the value as a string. Derived classes can override this to determine the formating used for ServiceStack.Blazor.Components.TextInputBase%601.CurrentValueAsString
.
View Source
protected virtual string FormatValueAsString(TValue value)
Returns
System.String
: A string representation of the value.
Parameters
Type | Name | Description |
---|---|---|
<TValue> | value | The value to format. |
|
TryParseValueFromString(String, out TValue, out String)
Parses a string to create an instance of <code data-dev-comment-type="typeparamref" class="typeparamref">TValue</code>. Derived classes can override this to change how
ServiceStack.Blazor.Components.TextInputBase%601.CurrentValueAsString
interprets incoming values.
View Source
protected virtual bool TryParseValueFromString(string value, out TValue result, out string validationErrorMessage)
Returns
System.Boolean
: True if the value could be parsed; otherwise false.
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string value to be parsed. |
|
| <TValue>
| result | An instance of <code data-dev-comment-type="typeparamref" class="typeparamref">TValue</code>.
|
| System.String
| validationErrorMessage | If the value could not be parsed, provides a validation error message.
|
SetParametersAsync(ParameterView)
View Source
public override Task SetParametersAsync(ParameterView parameters)
Returns
Task
Parameters
Type | Name |
---|---|
ParameterView | parameters |
Inherited Methods
CssClass(String, String)
View Source
protected override string CssClass(string valid = null, string invalid = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | valid |
System.String | invalid |
OnValidateStateChanged(Object, AspNetCore.Components.Forms.ValidationStateChangedEventArgs)
View Source
protected void OnValidateStateChanged(object sender, AspNetCore.Components.Forms.ValidationStateChangedEventArgs eventArgs)
Parameters
Type | Name |
---|---|
System.Object | sender |
Microsoft.AspNetCore.Components.Forms.ValidationStateChangedEventArgs | eventArgs |
StateClasses(String, String)
View Source
protected override string StateClasses(string valid = null, string invalid = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | valid |
System.String | invalid |
UpdateAdditionalValidationAttributes()
View Source
protected void UpdateAdditionalValidationAttributes()